const wearDao=require('../dao/wearDao');

//路由要传一个kind的进来
async function findByKind(kind){

    // if(kind==null||kind=={}||kind==undefined||kind==[]){
    //     kind='kid';
    // }
    try{
        //查询衣服，能返回
        var data=await wearDao.findByKind(kind);
        // console.log(data);
        return {success:true,wears:data};
    }catch (e) {
        //不能返回
        return {success:false,msg:'database is error'+e};
    }
}

async function findByKind1(kind){

    // if(kind==null||kind=={}||kind==undefined||kind==[]){
    //     kind='kid';
    // }
    try{
        //查询衣服，能返回
        var data=await wearDao.findByKind1(kind);
        // console.log(data);
        return {success:true,wears:data};
    }catch (e) {
        //不能返回
        return {success:false,msg:'database is error'+e};
    }
}
exports.findByKind=findByKind;
exports.findByKind1=findByKind1;